/*
 * PKL 51 GUNUNG KIDUL
 * Subseksie DATA ENTRY + CAPI
 */
package pkl51.controller;

import java.util.logging.Level;
import java.util.logging.Logger;
import pkl51.error.EntityException;
import pkl51.model.ListBlok4Model;

/**
 *
 * @author Hindarwan
 */
public class Blok4Controller {

    private ListBlok4Model model;

    public void setModel(ListBlok4Model model) {
        this.model = model;
    }

    public void insertAllBlok4() throws EntityException {
        try {
            model.insertAllBlok4();
        } catch (EntityException ex) {
            Logger.getLogger(Blok4Controller.class.getName()).log(Level.SEVERE, null, ex);
            throw new EntityException("Save data Blok 4 gagal");

        }
    }

    public void updateAllBlok4() throws EntityException {
        try {
            model.updateAllBlok4();
        } catch (EntityException ex) {
            Logger.getLogger(Blok4Controller.class.getName()).log(Level.SEVERE, null, ex);
            throw new EntityException("Update data Blok 4 gagal");
        }
    }

    public void getAllBlok4() throws EntityException {
        try {
            model.getAllBlok4();
        } catch (EntityException ex) {
            Logger.getLogger(Blok4Controller.class.getName()).log(Level.SEVERE, null, ex);
            throw new EntityException("Data Blok 4 tidak berhasil diload");
        }
    }
}
